package com.wl.application.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wl.application.entity.Menu;
import com.wl.application.entity.Role;
import com.wl.application.entity.User;
import com.wl.application.entity.UserRole;
import com.wl.application.entity.vo.AllotVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;
import java.util.Set;

/**
 * @author wl
 * @version 1.0
 * @date 2022/6/23
 * @description:
 */
public interface AllotMapper extends BaseMapper<UserRole> {
    List<Integer> PowerInfo(@Param(("rid")) Integer rid);

    int deleteAllPowerForId(AllotVo allotVo);

    int addPowerForId(AllotVo allotVo);

    Page<User> getUserListByRidPage(@Param("page") IPage<User> page, @Param("allot") AllotVo allotVo);

    List<Integer> selectAllByRid(Integer rid);

    int addRoleToUser(@Param(("rid")) Integer rid,@Param("UserIdList") List<Integer> users);

    int removeUserAndUr(@Param("uidList") List<Integer> ids);

    List<Integer> getRidByUid(@Param("uid") Integer uid);

    Set<Menu> getRole(@Param(("uid")) Integer userId);
}
